<html>
	<head>
		<title><?php echo $RAML->title; ?>: <?php echo $RAML->getCurrentPath(); ?></title>
		<meta charset="utf-8">
		
		<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.7/styles/default.min.css">
		
		<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
		<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.7/highlight.min.js"></script>
		<script>
			$(document).ready(function(){
				hljs.configure({useBR: true});

				$('code, div.apiresponse').each(function(i, block) {
				  hljs.highlightBlock(block);
				});
			});
		</script>
		
		<style type="text/css">
		
			*, *:before, *:after {
			  -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
			}
			
			body { margin: 0; }
			
			body, table {
				margin: 0;
				font-family: arial;
				font-size: 12px;
			}
			
			a { 
				text-decoration: none;
			}
			
			h3 {
				margin-top: 40px;
			}
			
			header {
				padding: 10px 20px;
				background: #333;
				color: #fff;
				border-bottom: 2px solid #999;
			}
			
			header a {
				color: #fff;
			}
			
			#container { position: relative; }
			
			article {
				margin: 0 20px;
			}
			
			nav {
				border-left: 1px dashed #999;
				padding: 0 15px;
			}
			
			footer {
				clear: both;
				margin-top: 30px;
				padding: 10px 20px;
				text-align: center;
				font-size: 10px;
				background: #333;
				color: #999;
				border-top: 2px solid #999;
			}
			
			footer a {
				color: #ccc;
			}
			
			.alert, .info, .warning {
				width: 96%; 
				margin: 0;
				padding: 8px 15px;
				border: 2px solid #075698;
				background: #AEEAFF;
				color: #333;
				font-weight: bold;
			}
			
			.warning {
				border-color: #f3961c;
				background: #FFE5B4;
			}
			
			.alert {
				border-color: #900;
				background: #DC381F;
				color: #fff;
			}
			
			table {
				width: 96%;
				border: 1px solid #333;
			}
			
			table thead tr td {
				background: #666;
				color: #fff;
				font-weight: bold;
			}
			
			table tr {
				padding: 15px 0;
			}
			
			tr:nth-child(odd) {
			    background-color: #f3f3f3;
			}
			
			table td {
				vertical-align: top;
				padding: 5px;
			}
			
			.badge {
				display: inline-block;
				font-size: 14px;
				padding: 5px;
				margin-right: 20px;
		        border-radius: 0;
		        text-transform: uppercase;
		        width: 70px;
		        font-weight: normal;
		        color: #f3f3f6;
		        line-height: normal;
		        background-color: #999;
		        text-align: center;
		    }
		    .block.collapsed .badge {
		        visibility: visible;
		    }
		    .badge_get {
		        background-color: #63a8e2;
		    }
		    .badge_post {
		        background-color: #6cbd7d;
		    }
		    .badge_put {
		        background-color: #22bac4;
		    }
		    .badge_patch {
		    	background-color: #02b0e2;
		    }
		    .badge_delete {
		        background-color: #d26460;
		    }
		    .badge_connect {
		    	background-color: #e48f0a;
		    }
		    .badge_trace {
		    	background-color: #98b805;
		    }
		    
		    .text_get {
		        color: #0b88b9;
		    }
		    .text_post {
		        color: #6cbd7d;
		    }
		    .text_put {
		        color: #22bac4;
		    }
		    .text_patch {
		    	color: #02b0e2;
		    }
		    .text_delete {
		        color: #d26460;
		    }
		    .text_connect {
		    	color: #e48f0a;
		    }
		    .text_trace {
		    	color: #98b805;
		    }
		    
		    .online {
		    	color: #090;
		    }
		    
		    .offline {
		    	color: #F00;
		    }
		    
		    
		    ul.verbs, ul.resources, nav ul {
		    	margin: 0;
		    	padding: 0;
		    	list-style-type: none;
		    }
		    
		    ul.verbs li, ul.resources li {
		    	padding: 0 0 10px 0;
		    	margin: 0 0 10px 0;
		    	border-bottom: 1px dotted #ccc;
		    }
		    
		    ul.resources li a {
		    	font-weight: bold;
		    	font-size: 16px;
		    	color: #666;
		    }
		    
		    ul.resources li a:hover {
		    	color: #63a8e2;
		    }
		    
		    .codeSampleLink {
		    	display: inline-block;
		    	border: 1px solid #333;
		    	padding: 5px;
		    	margin-right: 5px;
		    	text-decoration: none;
		    	color: #333;
		    }
		    
		    .activeCodeSample {
		    	background: #333 !important;
		    	color: #fff;
		    }
		    
		    nav ul li a {
		    	display: block;
		    	padding: 0 0 10px 0;
		    	margin: 0 0 10px 0;
		    	border-bottom: 1px dotted #ccc;
		    	font-size: 14px;
		    	color: #666;
		    }
		    
		    nav ul li a:hover {
		    	font-weight: bold;
		    }
		    
		    div.apiresponse, code {
		    	width: 96%;
		    	max-height: 300px;
		    	background: #f3f3f3;
		    	border: 1px solid #333;
		    	padding: 10px;
		    	overflow: scroll;
		    	font-family: monospace;
		    	font-size: 11px;
		    }
			
			@media screen and (min-width: 60em ) {
			  nav { float: right; top: 0; right: 0; width: 30em; }
			  article { margin-right: 30.75em; }
			
				   
			}
		
		</style>
		
	</head>

	<body>
		<header>
			<h1><a href="<?php echo $_SERVER['PHP_SELF']; ?>"><?php echo $RAML->get('title'); ?></a></h1>
			<p>version <?php echo $RAML->get('version'); ?> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <?php echo $RAML->get('baseUri'); ?></p>
		</header>
		
		
		<div id="container">
			
			<nav>
				<?php 
				include('_menu.phtml');
				?>
			</nav>
		
			<article>		
				<?php if ($RAML->getCurrentPath() != '/'): ?>
					<h2><?php echo $RAML->getCurrentPath(); ?></h2>
				<?php elseif (!$RAML->path()->description): ?>
					<!-- CSS HACK --><img width="1" height="1" />
				<?php endif; ?>
				
				
				<?php $validPath = $RAML->isPathValid($RAML->getCurrentPath()); ?>
				
				
				<?php if($validPath && !$RAML->getCurrentAction() && $RAML->path()->description):
					echo RAML2HTML\markdown::parse($RAML->path()->description); 
				endif; ?>
				
				
				<?php
				if (!$validPath):
					include('_404.phtml');
				endif;
				?>
				
				
				<?php 
				if ($validPath && $RAML->path()->getVerbs() && !$RAML->getCurrentAction()):
					include('_verbs.phtml');
				endif;
				?>
				
				
				
				<?php 
				if ($validPath && $RAML->getChildPaths($RAML->getCurrentPath()) && !$RAML->getCurrentAction()):
					include('_resources.phtml');
				endif;
				?>
				
				
				<?php
				if ($RAML->getCurrentAction()):
					include('_action.phtml');
					if ($disqus && $disqus_shortname):
 						include('_comments.phtml');
					endif;
				endif;
				?>
				
			
			</article>

			<div style="clear: both;"></div>

		</div>

		<footer>
			powered by <a href="http://www.raml.org">RAML</a> &nbsp; &nbsp; | &nbsp; &nbsp; script by <a href="http://www.mikestowe.com/2014/05/raml-2-html.php" target="_blank">MikeStowe.com</a>
		</footer>
	</body>
</html>
